Integrand size = 21, antiderivative size = 156 \[ \int \sin ^2(c+d x) (a+a \sin (c+d x))^n \, dx=\frac {\cos (c+d x) (a+a \sin (c+d x))^n}{d \left (2+3 n+n^2\right )}-\frac {2^{\frac {1}{2}+n} \left (1+n+n^2\right ) \cos (c+d x) \operatorname {Hypergeometric2F1}\left (\frac {1}{2},\frac {1}{2}-n,\frac {3}{2},\frac {1}{2} (1-\sin (c+d x))\right ) (1+\sin (c+d x))^{-\frac {1}{2}-n} (a+a \sin (c+d x))^n}{d (1+n) (2+n)}-\frac {\cos (c+d x) (a+a \sin (c+d x))^{1+n}}{a d (2+n)} \]
cos(d*x+c)*(a+a*sin(d*x+c))^n/d/(n^2+3*n+2)-2^(1/2+n)*(n^2+n+1)*cos(d*x+c) *hypergeom([1/2, 1/2-n],[3/2],1/2-1/2*sin(d*x+c))*(1+sin(d*x+c))^(-1/2-n)* (a+a*sin(d*x+c))^n/d/(n^2+3*n+2)-cos(d*x+c)*(a+a*sin(d*x+c))^(1+n)/a/d/(2+ n)
Leaf count is larger than twice the leaf count of optimal. \(1732\) vs. \(2(156)=312\).
Time = 21.41 (sec) , antiderivative size = 1732, normalized size of antiderivative = 11.10 \[ \int \sin ^2(c+d x) (a+a \sin (c+d x))^n \, dx =\text {Too large to display} \]
(-2*Sin[c + d*x]^2*(a + a*Sin[c + d*x])^n*(a + (a*Tan[c + d*x])/Sqrt[Sec[c + d*x]^2])^n*(Sec[c + d*x]^2 + Sqrt[Sec[c + d*x]^2]*Tan[c + d*x])*(1 + (S qrt[Sec[c + d*x]^2] + Tan[c + d*x])^2)^n*(-((3 + 2*n)*Hypergeometric2F1[1/ 2 + n, 1 + n, 3/2 + n, -(Sqrt[Sec[c + d*x]^2] + Tan[c + d*x])^2]) + 4*(1 + 2*n)*Hypergeometric2F1[3/2 + n, 3 + n, 5/2 + n, -(Sqrt[Sec[c + d*x]^2] + Tan[c + d*x])^2]*(1 + 2*Sqrt[Sec[c + d*x]^2]*Tan[c + d*x] + 2*Tan[c + d*x] ^2)))/(d*(3 + 8*n + 4*n^2)*Sqrt[Sec[c + d*x]^2]*((-4*n*(Sqrt[Sec[c + d*x]^ 2] + Tan[c + d*x])*(a + (a*Tan[c + d*x])/Sqrt[Sec[c + d*x]^2])^n*(Sec[c + d*x]^2 + Sqrt[Sec[c + d*x]^2]*Tan[c + d*x])^2*(1 + (Sqrt[Sec[c + d*x]^2] + Tan[c + d*x])^2)^(-1 + n)*(-((3 + 2*n)*Hypergeometric2F1[1/2 + n, 1 + n, 3/2 + n, -(Sqrt[Sec[c + d*x]^2] + Tan[c + d*x])^2]) + 4*(1 + 2*n)*Hypergeo metric2F1[3/2 + n, 3 + n, 5/2 + n, -(Sqrt[Sec[c + d*x]^2] + Tan[c + d*x])^ 2]*(1 + 2*Sqrt[Sec[c + d*x]^2]*Tan[c + d*x] + 2*Tan[c + d*x]^2)))/((3 + 8* n + 4*n^2)*Sqrt[Sec[c + d*x]^2]) + (2*Tan[c + d*x]*(a + (a*Tan[c + d*x])/S qrt[Sec[c + d*x]^2])^n*(Sec[c + d*x]^2 + Sqrt[Sec[c + d*x]^2]*Tan[c + d*x] )*(1 + (Sqrt[Sec[c + d*x]^2] + Tan[c + d*x])^2)^n*(-((3 + 2*n)*Hypergeomet ric2F1[1/2 + n, 1 + n, 3/2 + n, -(Sqrt[Sec[c + d*x]^2] + Tan[c + d*x])^2]) + 4*(1 + 2*n)*Hypergeometric2F1[3/2 + n, 3 + n, 5/2 + n, -(Sqrt[Sec[c + d *x]^2] + Tan[c + d*x])^2]*(1 + 2*Sqrt[Sec[c + d*x]^2]*Tan[c + d*x] + 2*Tan [c + d*x]^2)))/((3 + 8*n + 4*n^2)*Sqrt[Sec[c + d*x]^2]) - (2*n*(a + (a*...
Time = 0.56 (sec) , antiderivative size = 158, normalized size of antiderivative = 1.01, number of steps used = 8, number of rules used = 8, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.381, Rules used = {3042, 3238, 3042, 3230, 3042, 3131, 3042, 3130}
Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.
\(\displaystyle \int \sin ^2(c+d x) (a \sin (c+d x)+a)^n \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \sin (c+d x)^2 (a \sin (c+d x)+a)^ndx\) |
\(\Big \downarrow \) 3238 |
\(\displaystyle \frac {\int (a (n+1)-a \sin (c+d x)) (\sin (c+d x) a+a)^ndx}{a (n+2)}-\frac {\cos (c+d x) (a \sin (c+d x)+a)^{n+1}}{a d (n+2)}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {\int (a (n+1)-a \sin (c+d x)) (\sin (c+d x) a+a)^ndx}{a (n+2)}-\frac {\cos (c+d x) (a \sin (c+d x)+a)^{n+1}}{a d (n+2)}\) |
\(\Big \downarrow \) 3230 |
\(\displaystyle \frac {\frac {a \left (n^2+n+1\right ) \int (\sin (c+d x) a+a)^ndx}{n+1}+\frac {a \cos (c+d x) (a \sin (c+d x)+a)^n}{d (n+1)}}{a (n+2)}-\frac {\cos (c+d x) (a \sin (c+d x)+a)^{n+1}}{a d (n+2)}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {\frac {a \left (n^2+n+1\right ) \int (\sin (c+d x) a+a)^ndx}{n+1}+\frac {a \cos (c+d x) (a \sin (c+d x)+a)^n}{d (n+1)}}{a (n+2)}-\frac {\cos (c+d x) (a \sin (c+d x)+a)^{n+1}}{a d (n+2)}\) |
\(\Big \downarrow \) 3131 |
\(\displaystyle \frac {\frac {a \left (n^2+n+1\right ) (\sin (c+d x)+1)^{-n} (a \sin (c+d x)+a)^n \int (\sin (c+d x)+1)^ndx}{n+1}+\frac {a \cos (c+d x) (a \sin (c+d x)+a)^n}{d (n+1)}}{a (n+2)}-\frac {\cos (c+d x) (a \sin (c+d x)+a)^{n+1}}{a d (n+2)}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {\frac {a \left (n^2+n+1\right ) (\sin (c+d x)+1)^{-n} (a \sin (c+d x)+a)^n \int (\sin (c+d x)+1)^ndx}{n+1}+\frac {a \cos (c+d x) (a \sin (c+d x)+a)^n}{d (n+1)}}{a (n+2)}-\frac {\cos (c+d x) (a \sin (c+d x)+a)^{n+1}}{a d (n+2)}\) |
\(\Big \downarrow \) 3130 |
\(\displaystyle \frac {\frac {a \cos (c+d x) (a \sin (c+d x)+a)^n}{d (n+1)}-\frac {a 2^{n+\frac {1}{2}} \left (n^2+n+1\right ) \cos (c+d x) (\sin (c+d x)+1)^{-n-\frac {1}{2}} (a \sin (c+d x)+a)^n \operatorname {Hypergeometric2F1}\left (\frac {1}{2},\frac {1}{2}-n,\frac {3}{2},\frac {1}{2} (1-\sin (c+d x))\right )}{d (n+1)}}{a (n+2)}-\frac {\cos (c+d x) (a \sin (c+d x)+a)^{n+1}}{a d (n+2)}\) |
-((Cos[c + d*x]*(a + a*Sin[c + d*x])^(1 + n))/(a*d*(2 + n))) + ((a*Cos[c + d*x]*(a + a*Sin[c + d*x])^n)/(d*(1 + n)) - (2^(1/2 + n)*a*(1 + n + n^2)*C os[c + d*x]*Hypergeometric2F1[1/2, 1/2 - n, 3/2, (1 - Sin[c + d*x])/2]*(1 + Sin[c + d*x])^(-1/2 - n)*(a + a*Sin[c + d*x])^n)/(d*(1 + n)))/(a*(2 + n) )
3.2.42.3.1 Defintions of rubi rules used
Int[((a_) + (b_.)*sin[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> Simp[(-2^(n + 1/2))*a^(n - 1/2)*b*(Cos[c + d*x]/(d*Sqrt[a + b*Sin[c + d*x]]))*Hypergeome tric2F1[1/2, 1/2 - n, 3/2, (1/2)*(1 - b*(Sin[c + d*x]/a))], x] /; FreeQ[{a, b, c, d, n}, x] && EqQ[a^2 - b^2, 0] && !IntegerQ[2*n] && GtQ[a, 0]
Int[((a_) + (b_.)*sin[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> Simp[a^IntPar t[n]*((a + b*Sin[c + d*x])^FracPart[n]/(1 + (b/a)*Sin[c + d*x])^FracPart[n] ) Int[(1 + (b/a)*Sin[c + d*x])^n, x], x] /; FreeQ[{a, b, c, d, n}, x] && EqQ[a^2 - b^2, 0] && !IntegerQ[2*n] && !GtQ[a, 0]
Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*sin[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[(-d)*Cos[e + f*x]*((a + b*Sin[e + f*x])^m/( f*(m + 1))), x] + Simp[(a*d*m + b*c*(m + 1))/(b*(m + 1)) Int[(a + b*Sin[e + f*x])^m, x], x] /; FreeQ[{a, b, c, d, e, f, m}, x] && NeQ[b*c - a*d, 0] && EqQ[a^2 - b^2, 0] && !LtQ[m, -2^(-1)]
Int[sin[(e_.) + (f_.)*(x_)]^2*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_), x_Symbol] :> Simp[(-Cos[e + f*x])*((a + b*Sin[e + f*x])^(m + 1)/(b*f*(m + 2 ))), x] + Simp[1/(b*(m + 2)) Int[(a + b*Sin[e + f*x])^m*(b*(m + 1) - a*Si n[e + f*x]), x], x] /; FreeQ[{a, b, e, f, m}, x] && EqQ[a^2 - b^2, 0] && ! LtQ[m, -2^(-1)]
\[\int \left (\sin ^{2}\left (d x +c \right )\right ) \left (a +a \sin \left (d x +c \right )\right )^{n}d x\]
\[ \int \sin ^2(c+d x) (a+a \sin (c+d x))^n \, dx=\int { {\left (a \sin \left (d x + c\right ) + a\right )}^{n} \sin \left (d x + c\right )^{2} \,d x } \]
\[ \int \sin ^2(c+d x) (a+a \sin (c+d x))^n \, dx=\int \left (a \left (\sin {\left (c + d x \right )} + 1\right )\right )^{n} \sin ^{2}{\left (c + d x \right )}\, dx \]
\[ \int \sin ^2(c+d x) (a+a \sin (c+d x))^n \, dx=\int { {\left (a \sin \left (d x + c\right ) + a\right )}^{n} \sin \left (d x + c\right )^{2} \,d x } \]
\[ \int \sin ^2(c+d x) (a+a \sin (c+d x))^n \, dx=\int { {\left (a \sin \left (d x + c\right ) + a\right )}^{n} \sin \left (d x + c\right )^{2} \,d x } \]
Timed out. \[ \int \sin ^2(c+d x) (a+a \sin (c+d x))^n \, dx=\int {\sin \left (c+d\,x\right )}^2\,{\left (a+a\,\sin \left (c+d\,x\right )\right )}^n \,d x \]